import * as React from 'react';
import {Datagrid} from "@/components/datagrid";
import {Form} from "@/components/form";
import {serverFetch} from "@/components/server-fetch";

export default async function Page() {
    const api_type = 'employee'
    const data = await serverFetch(api_type)
    const dataJson = {
        employeeId: {name: '员工编号', type: 'number'},
        employeeName: {name: '姓名', type: 'string'},
        birthplace: {name: '籍贯', type: 'string'},
        department: {name: '部门', type: 'string'},
        position: {name: '职位', type: 'string'},
        permissionCode: {name: '权限', type: 'string'},
        phone: {name: '手机号', type: 'string'},
        sex: {name: '性别', type: 'number'},
        status: {name: '状态', type: 'string'},
    }

    return (
        <main className='px-5'>
            <p className="text-3xl py-5">
                # 员工信息
            </p>
            <Datagrid rows={data.data} keyword={'employeeId'} list={dataJson} type={api_type}/>
            <Form list={dataJson} type={api_type}/>
        </main>
    )
}
